Skip to content

Remove the WASM function runtime - #4885

Open
Adham-Kiwan wants to merge 1 commit into
kptdev:mainfrom
Adham-Kiwan:remove-wasm-runtime
Open

Adham-Kiwan wants to merge 1 commit into
kptdev:mainfrom
Adham-Kiwan:remove-wasm-runtime

Conversation

@Adham-Kiwan

Copy link
Copy Markdown

Description

This removes the WASM function runtime from kpt, as agreed in #4881 and discussion #4878.

  • Delete pkg/fn/runtime/wasmtime.go, wasmtime_unsupported.go, nodejs.go and jsglue.go.
  • Drop the github.com/bytecodealliance/wasmtime-go and github.com/prep/wasmexec dependencies from go.mod.
  • Keep NewWasmFn and WasmFn.Run as stubs. Both now return a new ErrWasmFunctionsRemoved error: support for WASM functions has been removed from kpt, run the function as a container image or an executable instead. The WasmLoader, OciLoader and FsLoader types stay, as the issue asks, in case WASM support comes back later.
  • Update the --allow-alpha-wasm help text for fn eval and fn render so it says the feature was removed. I kept the flag so existing scripts get the clear error and not "unknown flag".
  • Change the fn-render/basicpipeline-wasm and fn-eval/wasm-function e2e cases to expect the new error. Drop their setup.sh/teardown.sh and the KPT_FN_WASM_RUNTIME ?= nodejs default in make/info.mk, since nothing reads that variable any more.

What this PR leaves alone:

  • kpt alpha wasm push/pull and pkg/wasm. They are OCI push/pull helpers and do not use the runtime. I can remove them here or in a follow-up, whichever you prefer.
  • The documentation. Per the PR template, docs will come in a separate Docs: PR for Update WASM related documentation #4883.
  • The two // indirect entries in cli/go.mod. go mod tidy in cli/ can't run until a root module release contains this change.

Fixes #4882

Testing

  • go build ./... and go vet ./pkg/fn/... ./cli/fn/... with the workspace from make work
  • go test ./pkg/fn/... ./cli/fn/... pass
  • go test --tags=docker --run='TestFnRender/testdata/fn-render/basicpipeline-wasm|TestFnEval/testdata/fn-eval/wasm-function' ./e2e/ pass against a freshly built binary

AI usage

I have used AI in the creation of this PR.

I have used the following AI tools:

  • Claude Code (Claude Opus 5.5) to find the WASM code paths, make the change, and run the build and tests

I have reviewed the change and can explain it independently of the tool.

Remove the wasmtime and Node.js based WASM runtimes together with the
wasmtime-go and wasmexec dependencies, as agreed in kptdev#4881.

NewWasmFn and WasmFn.Run are kept as stubs that return
ErrWasmFunctionsRemoved, so running a function with --allow-alpha-wasm
now fails with an error that says the feature was removed. The WASM
loaders are left in place in case WASM support is revisited.

The WASM e2e test cases now check for that error, and the
KPT_FN_WASM_RUNTIME default is dropped from the Makefile.

Fixes kptdev#4882

Assisted-by: Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Adham Kiwan <adhamkiwan@outlook.com>
@Adham-Kiwan
Adham-Kiwan requested review from a team and a balanced review from Copilot November 18, 2026 23:34
@netlify

netlify Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kptdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f6a4eda
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6afe3610ae1702af58ba3547
😎 Deploy Preview https://deploy-preview-4885--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change removing WASM function execution.

No open issues 🎉

What changed in this PR

Removes WASM function execution from kpt for #4882, while retaining API stubs and CLI flags that report the feature’s removal. OCI push/pull helpers remain unchanged; documentation updates are deferred to #4883.

Changes:

  • Removes the Wasmtime and Node.js runtimes, JavaScript glue, and root-module runtime dependencies.
  • Makes NewWasmFn and WasmFn.Run return ErrWasmFunctionsRemoved and updates CLI flag help.
  • Updates end-to-end tests to expect failure and removes obsolete runtime setup.
File Description
pkg/​fn/​runtime/​wasmtime.go Deletes the Wasmtime runtime implementation.
pkg/​fn/​runtime/​wasmtime_unsupported.go Deletes the non-CGO Wasmtime fallback.
pkg/​fn/​runtime/​wasm.go Adds removal-error stubs while retaining loaders.
pkg/​fn/​runtime/​nodejs.go Deletes the Node.js WASM runtime.
pkg/​fn/​runtime/​jsglue.go Deletes JavaScript runtime glue.
make/​info.mk Removes the default WASM runtime environment setting.
go.sum Removes checksums for the deleted runtime dependencies.
go.mod Removes wasmtime-go and wasmexec dependencies.
e2e/​testdata/​fn-render/​basicpipeline-wasm/​.expected/​teardown.sh Removes obsolete environment cleanup.
e2e/​testdata/​fn-render/​basicpipeline-wasm/​.expected/​setup.sh Removes obsolete Node.js runtime selection.
e2e/​testdata/​fn-render/​basicpipeline-wasm/​.expected/​diff.patch Expects failed render status instead of resource mutations.
e2e/​testdata/​fn-render/​basicpipeline-wasm/​.expected/​config.yaml Expects a nonzero exit and the removal message.
e2e/​testdata/​fn-eval/​wasm-function/​.expected/​diff.patch Removes the expected successful resource mutation.
e2e/​testdata/​fn-eval/​wasm-function/​.expected/​config.yaml Expects a nonzero exit and the removal message.
cli/​fn/​render/​cmdrender.go Updates retained WASM flag help for render failures.
cli/​fn/​cmdeval/​cmdeval.go Updates retained WASM flag help for eval failures.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove WASM runtime from kpt

2 participants